﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutoSendMail
{
    class AppConfig
    {
        public static int MaxUseForOneSMTP
        {
            get
            {
                try
                {
                    return Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings["MaxUseForOneSMTP"]);
                }
                catch
                {
                    return 480;
                }
            }
        }
        public static int SleepInterval
        {
            get
            {
                try
                {
                    return Convert.ToInt32(System.Configuration.ConfigurationSettings.AppSettings["SleepInterval"]);
                }
                catch
                {
                    return 500;
                }
            }
        }
        public static String SenderEmail
        {
            get
            {
                try
                {
                    return System.Configuration.ConfigurationSettings.AppSettings["SenderEmail"];
                }
                catch
                {
                    return "";
                }
            }
        }

        public static String SenderName
        {
            get
            {
                try
                {
                    return System.Configuration.ConfigurationSettings.AppSettings["SenderName"];
                }
                catch
                {
                    return "";
                }
            }
        }
        public static String MailSubject
        {
            get
            {
                try
                {
                    return System.Configuration.ConfigurationSettings.AppSettings["MailSubject"];
                }
                catch
                {
                    return "";
                }
            }
        }
        public static String TempHtmlFilePath
        {
            get
            {
                try
                {
                    return System.Configuration.ConfigurationSettings.AppSettings["TempHtmlFilePath"];
                }
                catch
                {
                    return "";
                }
            }
        }
        public static String TempHtmlFileName
        {
            get
            {
                try
                {
                    return System.Configuration.ConfigurationSettings.AppSettings["TempHtmlFileName"];
                }
                catch
                {
                    return "";
                }
            }
        }
        
        public static Boolean CheckEmailAddress
        {
            get
            {
                try
                {
                    return Convert.ToBoolean(System.Configuration.ConfigurationSettings.AppSettings["CheckEmailAddress"]);
                }
                catch
                {
                    return true;
                }
            }
        }
    }
}
